package com.tjetc.dao;

import com.tjetc.domain.Category;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface CategoryMapper {
    @Select("select * from category")
    List<Category> list();

    Category get(@Param("id") Integer id,@Param("name") String name);

    @Insert("insert into category(name)values (#{name})")
    int add(Category category);

    @Update("update category set name = #{name} where id=#{id} ")
    int update(Category category);

    @Delete("delete from category where id=#{id}")
    int delete(int id);
}
